Media Messages
Enterprise can send messages containing images, videos and documents to his customers.
Before You Start
You need to meet all the prerequisites listed in the Before You Start section of the documentation.
Step 1: Make POST Request
Payload: image
{
"recipient_type": "individual",
"to": "xxxxx",
"type": "image",
"image": {
"link": "https://sample-videos.com/img/Sample-jpg-image-100kb.jpg",
"caption": "Hi"
},
"metadata": {
"messageId": "xxxxx",
"transactionId": "dsfsdfdfadgdfhh69665fd6",
"callbackDlrUrl": "http://xxx.com",
"media": {
"mimeType": "image/jpeg"
}
}
}
Note: Any image media file sent through the Sinch WhatsApp API can be atmost be 5 MB after processing.
Payload: video
{
"recipient_type": "individual",
"to": "xxxxx",
"type": "video",
"video": {
"link": "https://www.sampleurl.com/video.mp4",
"caption": "hello"
},
"metadata": {
"messageId": "xxxxx",
"transactionId": "dsfsdfdfadgdfhh69665fd6",
"callbackDlrUrl": "http://xxx.com",
"media": {
"mimeType": "video/mp4"
}
}
}
Note: Any video media file sent through the Sinch WhatsApp API can be atmost 16 MB after processing.
Payload: document pdf
{
"recipient_type": "individual",
"to": "xxxxx",
"type": "document",
"document": {
"link": "https://sample-file.com/pdf/Sample-file.pdf",
"caption": "Hi"
},
"metadata": {
"callbackDlrUrl": "http://xxx.com",
"media": {
"mimeType": "application/pdf"
}
}
}
Payload: document zip
{
"recipient_type": "individual",
"to": "919999XXXXXX",
"type": "document",
"document": {
"link": "https://sample-videos.com/zip/abc.zip",
"caption": "Hi"
},
"metadata": {
"messageId": "xxxx",
"transactionId": "xxxx",
"callbackDlrUrl": "http://xxx.com",
"media": {
"mimeType": "application/zip"
}
}
}
Note: Any document media file sent through the Sinch WhatsApp API can be atmost 100 MB after processing.
For more information on parameters, see:
Step 2: Check Your Response
The response example shows a sample response from the API request: Possible elements in responses includes,
- Success Response
Payload
{
"success": true,
"responseId": "1606887827245734233232332"
}
- An unsuccessful response contains an error message. See Error and Status Codes for more information.
Note : Calback URL is a optional paramter . Please use when you want to change the default URL(configured through smartta). It will only chnage the domain name othere paratemters will be same as configurated in smartta.